﻿<!--#include file="admin/Includes/constants.asp"-->
<!--#include file="admin/Includes/validate.asp"-->
<!--#include file="admin/Includes/Send_Mail.asp"-->


<%
Dim MsgID, AccessCode
Dim aData, hasData, TDalign
Dim isNotifySender
Dim isPreview, Style, Layout, SendDate, FromName, ToName, ImageName, MsgHeading, MsgText, SoundName, ArticleBackLink
Dim fromemail, toemail

isPreview=request("prev")
MsgID=request("msgid")
AccessCode=request("ac")

If MsgID <> "" and AccessCode <> "" Then
strSQL = "{CALL a_ecard_detail_sel ("& MsgID &","& AccessCode &")}"	
exec(strsql)

	If Not RS Is Nothing Then
	If Not RS.EOF Then
		aData = RS.getrows		
		hasData=True			
	End If
	End If	
	CloseCon	
End If
If isPreview="1" Then
	Style = request("Style")
	Layout=request("Layout")
	SendDate=formatdatetime(now(),2)
	FromName=request("rqFromName")
	ToName=request("rqToName") 
	ImageName=request("in") 
	MsgHeading=request("MsgHeading")
	MsgText=request("rqMsgText")
	SoundName=request("SoundName")
	ArticleBackLink=request("ArticleBackLink")
	
ElseIf hasData Then
	isNotifySender=aData(1,0)	
	Style=aData(2,0)
	Layout=aData(3,0)
	SendDate=aData(4,0)
	FromName=aData(5,0)
	fromemail = aData(6,0)	
	ToName=aData(7,0)
	toemail = aData(8,0)
	ImageName=aData(9,0)
	MsgHeading=aData(10,0)
	MsgText=aData(11,0)
	SoundName=aData(12,0)
	ArticleBackLink=aData(13,0)
	
	
	'send notifySender
	if isNotifySender = true and fromemail <> "" then
		dim psemail 
		psemail = getpsemail()
		dim subject, body
		subject = "Thiệp số thời trang đã được xem!"
		body = "Chào "&FromName&",<br><br>" &_
		
				"Thiệp số của bạn gởi đến "&ToName&" đã được  xem.<br><br>" &_
								
				"Thoitrang.com rất hân hạnh phục vụ những yêu cầu gởi thiệp của bạn trong tương lai.<br><br>" &_
				
				"Thân mến,<br>" &_
				"Thoitrang.com<br>" & psemail		
						
		call sentMail(strSMTP, origmail_to, "Ban quản trị thoitrang.com", fromemail, subject, body)	
	end if
End If

if MsgText <> "" and isnull(MsgText) = false then 
	MsgText = replace(MsgText, vbcrlf, "<br>")
end if


%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<Meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Thiệp số thời trang</title>	
	<Meta http-equiv=" content-language" content ="vi">
	<Meta name="Robots" content="noindex,nofollow">
	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> 
	<link rel="icon" href="favicon.ico" type="image/x-icon"> 
	<link rel="STYLESHEET" type="text/css" href="system/styles.css">
</head>
<body>
<div id="container">
<div id="bt2"><img src="hinh-thoi-trang/bg_top.gif" width="1049" height="20"></div>
<div id="tp">
<table border="0" cellpadding="0" cellspacing="0" width="990" align="center">	
	<!--top-->
	<!--#include file="system/top.asp" -->
	<!--/top-->
	<tr bgcolor="#6b5a60">
		<td width="160" style="height:1px;"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="1" border="0"></td>
		<td width="522" valign="top" rowspan="2">		
		<!--body content-->		
			<!--cover-->		
		<table border="0" cellpadding="0" cellspacing="1" bgcolor="#B6A8AD" width="100%">			
			<tr><td style="padding-left:12px;" colspan="2"><img src="hinh-thoi-trang/thiep-so-hp.gif" width="400" height="40"></td></tr>
			<tr>
				<!--col left-->		
				<td valign="top" colspan="2">
					<table cellpadding="0" cellspacing="0" border="0" bgcolor="#B6A8AD" width="100%">
					<tr bgcolor="#F7F6BD">	
					<%	If hasData or isPreview="1" Then
							If 	Layout = "1" Then	%>				
							<td width="520" valign="top" colspan="2" style="padding:0 6 0 6">
								<table cellpadding="0" cellspacing="0" border="0" width="100%">
								<tr>
									<td class="postcardTxt" height="15" width="50" style="padding-left:15px;padding-top:10px;" valign="top">From:<br>To:</td>
									<td class="postcardTxt" width="300" valign="top" style="padding-top:10px;"> <%= FromName %><br><%= ToName %></td>
									<td background="hinh-thoi-trang/postmark.gif" width="160" height="90"><div class="postcardTxt" style="font-size:10px;margin-left:8px;margin-top:23px;"><%=SendDate%></div></td>
								</tr>
								<tr><td colspan="3"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="5" border="0"></td></tr>
								<tr bgcolor="#B6A8AD"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="350" height="1" border="0"></td><td><img src="hinh-thoi-trang/de_clear.gif" alt="" width="160" height="1" border="0"></td></tr>
								<tr><td colspan="3" height="36"><b class="dtTitle" style="font-size:13px;" style="padding-left:15px;"><%=MsgHeading%></b></td></tr>
								<tr><td colspan="3" style="padding:0 15 0 15"><h5><%= MsgText %></h5></td></tr>
								<tr><td class="postcardTxt" colspan="3" valign="top"><img src="hinh-anh-nguoi-mau/<%=ImageName%>" vspace="6"><br>(<a href="<%= ArticleBackLink %>" class="link" style="color:#8D0045">Xem các hình khác trong Bộ sưu tập này</a>)</td></tr>
								<tr><td colspan="3"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="3" border="0"></td></tr>
								</table>
							</td>
							<% ElseIF Layout="2" Then %>							
							<td width="520" valign="top" colspan="2" style="padding:0 6 0 6">
								<table cellpadding="0" cellspacing="0" border="0" width="100%">
								<tr>
									<td class="postcardTxt" height="15" width="50" style="padding-left:15px;padding-top:10px;" valign="top">From:<br>To:</td>
									<td class="postcardTxt" width="300" valign="top" style="padding-top:10px;"> <%= FromName %><br><%= ToName %></td>
									<td background="hinh-thoi-trang/postmark.gif" width="160" height="90"><div class="postcardTxt" style="font-size:10px;margin-left:8px;margin-top:23px;"><%=SendDate%></div></td>
								</tr>
								<tr>
									<td colspan="3" valign="top"><img src="hinh-anh-nguoi-mau/<%=ImageName%>" vspace="6"></td>
								</tr>
								<tr><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="350" height="10" border="0"></td><td><img src="hinh-thoi-trang/de_clear.gif" alt="" width="160" height="10" border="0"></td></tr>
								<tr><td colspan="3"><b class="dtTitle" style="font-size:13px;" style="padding-left:15px"><%=MsgHeading%></b></td></tr>
								<tr><td colspan="3"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="10" border="0"></td></tr>
								<tr><td colspan="3" class="link" style="padding-left:15px;padding-right:15px;"><h5><%= MsgText %></h5>(<a href="<%= ArticleBackLink %>" class="link" style="color:#8D0045">Xem các hình khác trong Bộ sưu tập này</a>)</td></tr>
								<tr><td colspan="3"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="3" border="0"></td></tr>
								</table>
							</td>
							<% ElseIF Layout="3" Then %>	
							<td width="520" valign="top" colspan="2">
								<table cellpadding="0" cellspacing="0" border="0" width="100%">
								<tr>
									<td class="postcardTxt" height="15" width="50" style="padding-left:15px;padding-top:10px;" valign="top">From:<br>To:</td>
									<td class="postcardTxt" width="300" valign="top" style="padding-top:10px;"> <%= FromName %><br><%= ToName %></td>
									<td background="hinh-thoi-trang/postmark.gif" width="160" height="90"><div class="postcardTxt" style="font-size:10px;margin-left:8px;margin-top:23px;"><%=SendDate%></div></td>
								</tr>	
								<tr><td colspan="3"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="5" border="0"></td></tr>
								<tr bgcolor="#B6A8AD"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="350" height="1" border="0"></td><td><img src="hinh-thoi-trang/de_clear.gif" alt="" width="160" height="1" border="0"></td></tr>
								<tr>
									<td colspan="3">
										<table cellpadding="0" cellspacing="0" width="100%" border="0">					
										<td width="240" valign="top" style="padding-right:15px;padding-left:15px;" colspan="2">
											<table cellpadding="0" cellspacing="0" border="0" width="100%">
												<tr><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="10" border="0"></td></tr>
											<tr><td colspan="2"><b class="dtTitle" style="font-size:13px;"><%=MsgHeading%></b></td></tr>
											<tr><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="10" border="0"></td></tr>
											<tr><td colspan="2"><h5><%= MsgText %></h5></td></tr>
											<tr><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="3" border="0"></td></tr>
											</table>
										</td>
										<td valign="top" class="link" style="padding-right:10px;padding-top:10px;"><img src="hinh-anh-nguoi-mau/<%=ImageName%>" vspace="6"><br>
										<a href="<%= ArticleBackLink %>" class="link" style="color:#8D0045">(Xem các hình khác trong Bộ sưu tập này)</a>
										</td>
										</table>
									</td>
								</tr>
							</table>
							</td>
							<%	ElseIF Layout="4" Then  %>
							<td width="520" valign="top" colspan="2">
								<table cellpadding="0" cellspacing="0" border="0" width="100%">
								<tr>
									<td class="postcardTxt" height="15" width="50" style="padding-left:15px;padding-top:10px;" valign="top">From:<br>To:</td>
									<td class="postcardTxt" width="300" valign="top" style="padding-top:10px;"> <%= FromName %><br><%= ToName %></td>
									<td background="hinh-thoi-trang/postmark.gif" width="160" height="90"><div class="postcardTxt" style="font-size:10px;margin-left:8px;margin-top:23px;"><%=SendDate%></div></td>
								</tr>	
								<tr><td colspan="3"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="5" border="0"></td></tr>
								<tr bgcolor="#B6A8AD"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="350" height="1" border="0"></td><td><img src="hinh-thoi-trang/de_clear.gif" alt="" width="160" height="1" border="0"></td></tr>
								<tr>
									<td colspan="3">
										<table cellpadding="0" cellspacing="0" width="100%" border="0">	
										<td valign="top" class="link" style="padding-right:15px;padding-left:15px;padding-top:10px;"><img src="hinh-anh-nguoi-mau/<%=ImageName%>" vspace="6"><br>
										<a href="<%= ArticleBackLink %>" class="link" style="color:#8D0045">(Xem các hình khác trong Bộ sưu tập này)</a></td>
										<td width="240" valign="top">
											<table cellpadding="0" cellspacing="0" border="0" width="100%">
											<tr><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="10" border="0"></td></tr>
											<tr><td colspan="2"><b class="dtTitle" style="font-size:13px;padding-right:15px;"><%=MsgHeading%></b></td></tr>
											<tr><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="10" border="0"></td></tr>
											<tr><td colspan="2" style="padding-right:15px;"><h5><%= MsgText %></h5></td></tr>
											<tr><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="3" border="0"></td></tr>
											</table>
										</td>
										</table>
									</td>
								</tr>
							</table>
							</td>
							<% End If %>
						<%	Else %>
						<td colspan="2" style="padding:20 15 20 15" height="300" valign="top"><h5>Không có thiệp này hoặc thiệp đã hết hạn (thường là 1 tháng sau khi thiệp được gửi đi). Xin bạn vui lòng xem xét lại thông tin hoặc hãy copy và paste lại đường link trong email thông báo. Nếu bạn nghĩ rằng hệ thống Thiệp Số này gặp lỗi kỹ thuật. Xin vui lòng <a href="contact.asp?ckid=<%=ckid%>&r=TechSupport" class="link" style="text-decoration:underline">liên lạc với Phòng kỹ thuật.</a>.</h5></td>
						<% End If %>
					</tr>					
					<tr bgcolor="#F7F6BD"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="10" border="0"></td></tr>
					<tr bgcolor="#B6A8AD"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="10" border="0"></td></tr>
					</table>
				</td>
				<!--/col left-->							
			</tr>
		</table>
			<!--/text-->		
		<!--/body content-->
		</td>
		<td width="308" style="width:0px;"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="1" border="0"></td>
	</tr>
	<!--main body-->
	<tr bgcolor="#ffffff">
		<td bgcolor="#000000" width="160" valign="top">
		<!--#include file="system/left.asp" -->
		</td>
		<!--missing 1 TD because of Rowspan-->		
		<td bgcolor="#614B00" width="308" valign="top">
			<table border="0" cellpadding="0" cellspacing="0" width="308" align="right">
				<tr bgcolor="#000000"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="308" height="1" border="0"></td></tr>
				<form action="search.asp?ckid=<%=ckid%>" method="post">
				<tr bgcolor="#8D0045">
					<td width="154" valign="top" height="33" ><input type="text" name="search" value="Tìm kiếm" size="22" class="txtSearch"></td>
					<td width="154" valign="top" style="padding-top:7px;padding-left:3px;"><input type="submit" name="go" value="TÌM" class="btnGo"></td>
				</tr>
				</form>
				<tr bgcolor="#000000"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="1" border="0"></td></tr>
				<!--Ads Starts-->
				<tr><td align="center" colspan="2"><img src="hinh-quang-cao/neimanmarcus350x250.jpg" alt="" width="300" height="250" border="0"></td></tr>
				<!--Ads Ends-->
			</table>
		</td>
	</tr>
	<!--/main body-->
	<!--#include file="system/bottom.asp" -->
</table>
</div>
<div id="bt2"><img src="hinh-thoi-trang/bg_bottom.gif" width="1049" height="20"></div>
</div>
</body>
</html>
